package cn.service.Impl;

import cn.dao.ForumDao;
import cn.domain.Forum;
import cn.domain.PageBean;
import cn.service.ForumService;
import cn.utils.HQLHelper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by Administrator on 2017/4/1 0001.
 */
@Service
@Transactional
public class ForumServiceImpl implements ForumService {
    //注入Forum
    @Resource
    private ForumDao forumDao;

    @Override
    public void Save(Forum forum) {
            forumDao.save(forum);
    }

    @Override
    public void Delete(Long id) {
            forumDao.delete(id);
    }

    @Override
    public List<Forum> findAll() {
        return forumDao.findAll();
    }

    @Override
    public void Update(Forum forum) {
        forumDao.update(forum);
    }

    @Override
    public Forum getById(Long id) {
        return forumDao.getById(id);
    }

    @Override
    public void moveUp(Long id) {
        forumDao.moveUp(id);
    }

    @Override
    public void moveDown(Long id) {
        forumDao.moveDown(id);
    }

    @Override
    public void moveTop(Long id) {
        forumDao.moveTop(id);
    }

    @Override
    public PageBean getPageBean(HQLHelper hqlHelper, int currentPage) {
        return forumDao.getPageBean(hqlHelper,currentPage);
    }

}
